package cn.xiaolang.function.jdk8.functional_interface;

import org.apache.commons.lang3.RandomUtils;

import java.util.function.Consumer;
import java.util.function.Supplier;

/**
 * 供给性接口
 * <p>
 * 返回T类型参数，方法时 T get()
 * </p>
 *
 * @author fuhw/Dean
 * @date 2019-07-19
 */
public class SupplierInterface {

    public static void main(String[] args) {
        double v = handleSum(12, () -> 100D);
        System.out.println(v);
    }


    private static double handleSum(double money, Supplier<Double> supplier) {
        return money + supplier.get();
    }
}

